/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    sdmmc.h
  * @brief   This file contains all the function prototypes for
  *          the sdmmc.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __SDMMC_H__
#define __SDMMC_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

#define SDCARD_FORMAT_WHEN_INIT (0) /* Set to 1 to format the SD card when initializing the SD card driver */
#define SDCARD_TEST_WRITE_FILE  (0) /* Set to 1 to create a new file when initializing the SD card driver */
#define SDCARD_NEW_FILE_NAME    "0:/tom.txt" /* Set to the name of the file to create when initializing the SD card driver */

#define SPI_FLASH_FORMAT_WHEN_INIT (0) /* Set to 1 to format the SPI flash when initializing the SPI flash driver */
#define SPI_FLASH_TEST_WRITE_FILE  (0) /* Set to 1 to create a new file when initializing the SPI flash driver */
#define SPI_FLASH_NEW_FILE_NAME    "1:/a.txt" /* Set to the name of the file to create when initializing the SPI flash driver */
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern SD_HandleTypeDef hsd1;

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

void MX_SDMMC1_SD_Init(void);

#define   MSD_OK                        ((uint8_t)0x00)
#define   MSD_ERROR                     ((uint8_t)0x01)
#define   MSD_ERROR_SD_NOT_PRESENT      ((uint8_t)0x02)

/** 
  * @brief  SD transfer state definition  
  */     
#define   SD_TRANSFER_OK                ((uint8_t)0x00)
#define   SD_TRANSFER_BUSY              ((uint8_t)0x01)

#define SD_DATATIMEOUT           ((uint32_t)100000000)

#define BSP_SD_CardInfo HAL_SD_CardInfoTypeDef

/* USER CODE BEGIN Prototypes */

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __SDMMC_H__ */

